#pragma once
#include "PEParse.h"

class CMemImage:public CPEParse
{
public:
    CMemImage(void);
    CMemImage(IN HANDLE hProcess, IN LPCTSTR lpcszModName);
    ~CMemImage(void);

public:
    BOOL
    SetProcessModule(
        IN HANDLE hProcess,
        IN LPCTSTR lpcszModName
    );

public:

    virtual BOOL PeRead(IN ULONGLONG Offset, OUT PVOID Buffer, IN ULONG Length);
    virtual BOOL PeOpen();
    virtual BOOL PeWrite(IN ULONGLONG Offset, IN PVOID Buffer, IN ULONG Length);
    virtual VOID PeClose();

private:
    ULONG m_Base;
    HANDLE m_hProcess;

};

